<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IList<SupportPerson>>" %>
<%@ Import Namespace="RMH.Entities"%>


<table>
    <td valign="bottom">
        First Name: <br />
        <input type="text" id="supportPersonFirstName" />
    </td>
    <td valign="bottom">Last Name:<br />
     <input type="text" id="supportPersonLastName" /></td>
     <td valign="bottom" id="searchSupportPeopleButton"><button>Search</button></td>
</table>

<select id="SupportPersonID">
<% foreach (var person in Model) {%>
    <option value="<%=person.Id %>" personName="<%=person.GetFullName() %>"><%=person.GetFullName()%> <%=person.PhoneNumber %></option><%}%>
</select>

<!-- TODO: don't hard code this. viewmodel maybe? -->
<select id="RelationshipType">   
    <option value="0">Unknown</option>
    <option value="1">Mother</option>
    <option value="2">Father</option>
    <option value="3">Grandmother</option>
    <option value="4">Grandfather</option>
    <option value="5">Aunt</option>
    <option value="6">Uncle</option>
    <option value="7">Other</option>
</select>

<button id="addSupportPerson">Add Support Person</button>
<!--<button id="newSupportPerson">New Support Person</button>-->
<script type="text/javascript">
$(function() {
    // TODO: wire this up slicker.
    $('#searchSupportPeopleButton').click(function() {        
        rmh.ajax.run(rmh.searchSupportPeople)
        return false;
        });
        
    $('#addSupportPerson').click(function() {
        rmh.ajax.run(rmh.addSelectedSupportPerson)
        return false;
    });
});
</script>

